﻿CREATE TABLE [dbo].[Index]
(
	IndexID int IDENTITY(1,1) NOT NULL, 
	TableID int NOT NULL,
	IndexName varchar(100)  NULL,
	IndexType varchar(50) NULL,
	IndexSize decimal(10,2) NULL,
    Statistics_LastUpdatedDate datetime NULL,
	Fragmentation decimal(5,2) NULL,
	IS_PK bit,
	Recommendation varchar(60) NULL,
	CONSTRAINT [PK_Indexs] PRIMARY KEY CLUSTERED
	(
	 [IndexId] ASC
	)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE  [dbo].[Index] WITH CHECK ADD CONSTRAINT [FK_Indexs]  FOREIGN KEY([TableId])
REFERENCES [dbo].[Table] ([TableId])
GO

ALTER TABLE [dbo].[Table] CHECK CONSTRAINT [FK_Indexs]
GO